package com.hongguan.oms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Service;

/**
 * @author wangwei
 * @date 2010-2-2
 * @version 
 */
@Service
public class ProxyService {
	@Autowired
	private SqlMapClientTemplate sqlMapClientTemplate;
	public Object queryForObject(String statementName,Object parameterObject){
		return sqlMapClientTemplate.queryForObject(statementName, parameterObject);
	}
	public List queryForList(String statementName,Object parameterObject) {
		return sqlMapClientTemplate.queryForList(statementName, parameterObject);
	}
	public String getStatementName(String namespace,String name) {
		StringBuilder sb = new StringBuilder(namespace);
		sb.append(".");
		sb.append(name);
		return sb.toString();
	}
	public Object insert(String statementName,Object parameterObject) {
		return sqlMapClientTemplate.insert(statementName, parameterObject);
	}
	public int update(String statementName,Object parameterObject) {
		return sqlMapClientTemplate.update(statementName, parameterObject);
	}
	public int delete(String statementName,Object parameterObject) {
		return sqlMapClientTemplate.delete(statementName, parameterObject);
	}
}
